home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’93 / Unca Fenster / Source / Layers.h < prev    next >
Encoding:
Text File  |  1993-06-17  |  1.8 KB  |  44 lines  |  [TEXT/KAHL]

  1. /* Layers.h */
  2.  
  3. /* Part of the undocumented Layer Manager structures and calls
  4.  * Information found with the help of MacsBug under MacOS 7.0.
  5.  * Please note that using this information may make your mac
  6.  * explode (hey, this could be a subject for a QuickTime moovie !);
  7.  * so use at your own risks, this may break in the future,
  8.  * etc.. (usual disclaimeer).
  9.  * I only wish that Apple will document this manager in a very near
  10.  * future (let's dream...).
  11.  *
  12.  * What I found was that a layer is associated with each running
  13.  * applications (if it has a user-interface), which groups all
  14.  * windows of that application. This is how you can hide an application
  15.  * (remember 'applications' menu under system 7) and get the list of
  16.  * other applications windows. Have fun.
  17.  *
  18.  * PS : If you have more information on the Layer Manager, please
  19.  * let me know! You can join me at hugues@isoft.fr
  20.  */
  21.  
  22. // LayerRecord is similar to a WindowRecord.
  23. typedef WindowRecord LayerRecord;
  24. typedef WindowPeek LayerPtr;
  25.  
  26. // This function returns a pointer to the first layer record
  27. // of the front layer on screen (front application).
  28. // Other ones are then accessed by the GetNextLayer macro.
  29. pascal LayerPtr GetFirstLayer(void)
  30.     = {0x7003, 0xA829};
  31.  
  32. // This function returns a pointer to the first window record
  33. // in the windows list of this layer.
  34. pascal WindowPtr GetFirstLayerWindow(LayerPtr aLayer)
  35.     = {0x7006, 0xa829};
  36.  
  37. // Some macros to access other information, and to hide and show a layer
  38. #define GetNextLayer(aLayer) (aLayer->nextWindow)
  39. #define GetLayerInfo(aLayer) ((LayerInfoPtr)aLayer->refCon)
  40. #define HideLayer(aLayer) HideWindow((WindowPtr)aLayer)
  41. #define ShowLayer(aLayer) ShowWindow((WindowPtr)aLayer)
  42. #define ShowHideLayer(aLayer,showFlag) ShowHide((WindowPtr)aLayer, showFlag)
  43. #define HiddenLayer(aLayer) aLayer->visible
  44.